package l.l.w.practice.StringSplinter;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Scanner;
/**
 * Created by llw on 2017/10/3.
 */
public class StringSplinter {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String line = scanner.nextLine();
        double result = new StringSplinter().stringSplinter(line);
        System.out.println(String.format("%.2f",result));
    }

    public double stringSplinter(String line) {
        char flagChar = line.charAt(0);
        Map<String, Integer> map = new HashMap<>();
        int num = 1;
        StringBuilder sb = new StringBuilder();
        sb.append(flagChar);
        boolean flag = true;
        for(int i = 1; i < line.length(); ++i){

            if(flagChar == line.charAt(i)){
                sb.append(flagChar);

            }else{
                String s = sb.toString();
                if(map.containsKey(s)){
                    map.put(s,map.get(s)+1);
                }else{
                    map.put(s,1);
                }
                sb = new StringBuilder();
                flagChar = line.charAt(i);
                sb.append(flagChar);
            }
        }

        String s = sb.toString();
        if(map.containsKey(s)){
            map.put(s,map.get(s)+1);
        }else{
            map.put(s,1);
        }

        Iterator<Map.Entry<String, Integer>> iterator = map.entrySet().iterator();
        int count =0;
        while(iterator.hasNext()){
            Map.Entry<String, Integer> next = iterator.next();
            count += next.getValue();
        }
        return line.length()*1.0/count;
    }
}
